/*
 * main.cpp
 *
 *  Created on: Dec 5, 2013
 *      Author: thanhkm
 */

#include "Comparison.h"

int main(int argc, char** argv) {
	Comparison com = Comparison();

	cv::Mat img1;
	cv::Mat img2;

	//load image
	// read video
	if (argc < 3){
		cout<<"error"<<endl;
	} else {
		img1 = imread(argv[1], CV_LOAD_IMAGE_UNCHANGED);   // Read the file
		img2 = imread(argv[2], CV_LOAD_IMAGE_UNCHANGED);   // Read the file
	}

	if(!img1.data || !img2.data)                           // Check for invalid input
	{
		cout <<  "Could not open or find the image" << std::endl ;
		return -1;
	}

	//load threshold distance
	if (argc > 3) {
		double dist = atof(argv[3]);
		com.setDistanceMatched(dist);
	}

	//load threshold distance
	if (argc > 4) {
		double angle = atof(argv[4]);
		com.setAngleThreshold(angle);
	}

	int nbMatched = com.compareSift(img1, img2);
	cout<<"Sift number of matching : "<< nbMatched<< endl;

//	nbMatched = com.compareSurf(img1, img2);
//	cout<<"Suft number of matching : "<< nbMatched<< endl;

	cv::waitKey(0);
	return 0;
}




